#ifndef DIO_SERVING_QUEUE_1Q_H_
#define DIO_SERVING_QUEUE_1Q_H_
#include <fermat/dio/request_queue.h>
#include <fermat/dio/blocked_queue.h>
#include <fermat/common/thread.h>
#include <fermat/common/shared_state.h>

namespace fermat{

class ServingQueue1Q : public RequestQueue{
public:
	typedef BlockedQueue<RequestPtr> RequestList;
public:
	ServingQueue1Q();
	~ServingQueue1Q();
	bool start();

	void AddRequest(RequestPtr& req);
    bool CancelRequest(RequestPtr& req);
private:
	void work();
	bool stop();
private:
	RequestList  _queue;
	SharedState<RequestQueue::QueueState>  _stats;
	Thread      *_th;
};
}


#endif